from django.db import models

# Create your models here.

class Movie(models.Model):
    movie_name = models.CharField(max_length=255, verbose_name='电影名称')
    release_info = models.CharField(max_length=255, verbose_name='发行信息')
    split_box_rate = models.CharField(max_length=50, verbose_name='分账票房比例')
    show_count = models.IntegerField(verbose_name='排片场次')
    show_count_rate = models.CharField(max_length=50, verbose_name='排片场次占比')
    sum_box_desc = models.CharField(max_length=255, verbose_name='累计票房')
    created_at = models.DateTimeField(auto_now_add=True, verbose_name='创建时间')
    updated_at = models.DateTimeField(auto_now=True, verbose_name='更新时间')

    class Meta:
        verbose_name = '电影'
        verbose_name_plural = '电影'
        ordering = ['-created_at']

    def __str__(self):
        return self.movie_name

class MovieClean(models.Model):
    movie_name = models.CharField(max_length=255, verbose_name='电影名称')
    release_info = models.CharField(max_length=255, verbose_name='发行信息')
    split_box_rate = models.CharField(max_length=50, verbose_name='分账票房比例')
    show_count = models.IntegerField(verbose_name='排片场次')
    show_count_rate = models.CharField(max_length=50, verbose_name='排片场次占比')
    sum_box_desc = models.CharField(max_length=255, verbose_name='累计票房(万)')
    created_at = models.DateTimeField(auto_now_add=True, verbose_name='创建时间')
    updated_at = models.DateTimeField(auto_now=True, verbose_name='更新时间')

    class Meta:
        verbose_name = '清洗后电影信息'
        verbose_name_plural = verbose_name
        ordering = ['-created_at']
        db_table = 'movie_clean'

    def __str__(self):
        return self.movie_name
